import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routesFiles = require.context('./routes', true, /\.js$/)

const allRoutes = routesFiles.keys().reduce((routes, routePath) => {
  const route = routesFiles(routePath).default
  return routes.concat(route)
}, [])
export default new Router({
  routes: allRoutes
})
